<!doctype html>
<script src="../../../resources/testharness.js"></script>
<script src="../../../resources/testharnessreport.js"></script>
<script src="../../assert_selection.js"></script>
<script>
if (window.internals)
  internals.settings.setEditingBehavior('win');

selection_test(
  '<div contenteditable dir="ltr">|אאא <span>בב</span></div>',
  selection => selection.modify('move', 'left', 'word'),
  '<div contenteditable dir="ltr">|אאא <span>בב</span></div>',
  '1-0 left word');

selection_test(
  '<div contenteditable dir="ltr">א|אא <span>בב</span></div>',
  selection => selection.modify('move', 'left', 'word'),
  '<div contenteditable dir="ltr">|\u05D0\u05D0\u05D0 <span>\u05D1\u05D1</span></div>',
  '1-1 left word');

selection_test(
  '<div contenteditable dir="ltr">אא|א <span>בב</span></div>',
  selection => selection.modify('move', 'left', 'word'),
  '<div contenteditable dir="ltr">|\u05D0\u05D0\u05D0 <span>\u05D1\u05D1</span></div>',
  '1-2 left word');

selection_test(
  '<div contenteditable dir="ltr">אאא| <span>בב</span></div>',
  selection => selection.modify('move', 'left', 'word'),
  '<div contenteditable dir="ltr">|אאא <span>בב</span></div>',
  '1-3 left word');

selection_test(
  '<div contenteditable dir="ltr">אאא |<span>בב</span></div>',
  selection => selection.modify('move', 'left', 'word'),
  '<div contenteditable dir="ltr">|אאא <span>בב</span></div>',
  '1-4 left word');

selection_test(
  '<div contenteditable dir="ltr">אאא <span>|בב</span></div>',
  selection => selection.modify('move', 'left', 'word'),
  '<div contenteditable dir="ltr">|אאא <span>בב</span></div>',
  '1-5 left word');

selection_test(
  '<div contenteditable dir="ltr">אאא <span>ב|ב</span></div>',
  selection => selection.modify('move', 'left', 'word'),
  '<div contenteditable dir="ltr">\u05D0\u05D0\u05D0 |<span>\u05D1\u05D1</span></div>',
  '1-6 left word');

selection_test(
  '<div contenteditable dir="ltr">אאא <span>בב|</span></div>',
  selection => selection.modify('move', 'left', 'word'),
  '<div contenteditable dir="ltr">\u05D0\u05D0\u05D0 |<span>\u05D1\u05D1</span></div>',
  '1-7 left word');
</script>
